<template>
  <div>
    <div>{{ list }}</div>
    <div>{{ name }}</div>
    <div>{{ avatar }}</div>
  </div>
</template>

<script>
import { mapActions, mapGetters, mapState } from "vuex"; 
export default {
  name: "pie",
  computed: {
    ...mapState({
      name: (state) => state.user.name,
      avatar: (state) => state.user.avatar,
    }),
    ...mapGetters(["list"]),
  },
  created() {
    this.getList("aaaaaa");
    this.$store.dispatch("user/getUserInfo", {
      name: "尘之风",
      avatar:
        "https://tse1-mm.cn.bing.net/th/id/OIP.46Mhl3YGQle1Ca4O0w4oEwAAAA?w=201&h=200&c=7&o=5&pid=1.7",
    });
  },
  methods: {
    ...mapActions(["getList"]),
  },
};
</script>

<style>
</style>